<?php
namespace app\index\controller;
use think\Controller;
use think\Db;

class Index extends Controller {

	public function index() {
		//排行榜数据
	    $sql = "SELECT `logo`,`bankname`,`vir_number`,`id`,`tishi` FROM ims_xuan_zy_bank where status = 1  order by  rank desc limit 0,5";
        $articles = DB::query($sql);
        $this->assign("articles",$articles);
        //头部信息
        $tou=DB::query("SELECT logo FROM ims_xuan_zy_huan where status=1 and type='首页头部2' and uniacid=2 order by rank desc");
	   	//菜单信息
	    $caidans=DB::query("SELECT * FROM ims_xuan_zy_caidan where uniacid=2 and status=1  order by rank desc ");
	    $this->assign("caidans",$caidans);
	    $sql = "select * from ims_xuan_zy_bankorder order by create_time desc limit 0,20";
	    $list = DB::query($sql);
	  	foreach ($list as $key => $value) {
	  		$list[$key]['mobile'] = substr($value['mobile'],0,3)."****".substr($value['mobile'],7,15);
	  		$list[$key]['time'] = time()-strtotime($value['create_time']);
	  	}
	  	$this->assign("list",$list);
		return $this->fetch();

	} 

}
